<!DOCTYPE html>



  


<html class="theme-next gemini use-motion" lang="zh-Hans">
<head><meta name="generator" content="Hexo 3.8.0">
  <meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="theme-color" content="#222">









<meta http-equiv="Cache-Control" content="no-transform">
<meta http-equiv="Cache-Control" content="no-siteapp">
















  
  
  <link href="/limh/lib/fancybox/source/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css">







<link href="/limh/lib/font-awesome/css/font-awesome.min.css?v=4.6.2" rel="stylesheet" type="text/css">

<link href="/limh/css/main.css?v=5.1.4" rel="stylesheet" type="text/css">


  <link rel="apple-touch-icon" sizes="180x180" href="/limh/images/apple-touch-icon-next.png?v=5.1.4">


  <link rel="icon" type="image/png" sizes="32x32" href="/limh/images/favicon-32x32-next.png?v=5.1.4">


  <link rel="icon" type="image/png" sizes="16x16" href="/limh/images/favicon-16x16-next.png?v=5.1.4">


  <link rel="mask-icon" href="/limh/images/logo.svg?v=5.1.4" color="#222">





  <meta name="keywords" content="教程,">










<meta name="description" content="前面，我们介绍了完整的段定义格式，用完整的段定义格式虽然可以控制段的各种属性，但程序员很少会这样做。现在的汇编程序提供了一种简化的段定义方式，它使定义段更简单、方便。  6.4.1 存储模型说明伪指令在使用简化的段定义方式之前，必须使用存储模式说明伪指令来描述源程序所采用的存储模式。该伪指令说程序所使用的存储模式，汇编程序将用该存储模式生成相应的ASSUME和GROUP语句，同时也为其它的简化段创">
<meta name="keywords" content="教程">
<meta property="og:type" content="article">
<meta property="og:title" content="6.4 简化的段定义">
<meta property="og:url" content="https://tdnr.gitee.io/limh/2015/04/01/asm26/index.html">
<meta property="og:site_name" content="土逗牛肉">
<meta property="og:description" content="前面，我们介绍了完整的段定义格式，用完整的段定义格式虽然可以控制段的各种属性，但程序员很少会这样做。现在的汇编程序提供了一种简化的段定义方式，它使定义段更简单、方便。  6.4.1 存储模型说明伪指令在使用简化的段定义方式之前，必须使用存储模式说明伪指令来描述源程序所采用的存储模式。该伪指令说程序所使用的存储模式，汇编程序将用该存储模式生成相应的ASSUME和GROUP语句，同时也为其它的简化段创">
<meta property="og:locale" content="zh-Hans">
<meta property="og:updated_time" content="2019-01-21T13:59:48.418Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="6.4 简化的段定义">
<meta name="twitter:description" content="前面，我们介绍了完整的段定义格式，用完整的段定义格式虽然可以控制段的各种属性，但程序员很少会这样做。现在的汇编程序提供了一种简化的段定义方式，它使定义段更简单、方便。  6.4.1 存储模型说明伪指令在使用简化的段定义方式之前，必须使用存储模式说明伪指令来描述源程序所采用的存储模式。该伪指令说程序所使用的存储模式，汇编程序将用该存储模式生成相应的ASSUME和GROUP语句，同时也为其它的简化段创">



<script type="text/javascript" id="hexo.configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    root: '/limh/',
    scheme: 'Gemini',
    version: '5.1.4',
    sidebar: {"position":"left","display":"post","offset":12,"b2t":false,"scrollpercent":false,"onmobile":false},
    fancybox: true,
    tabs: true,
    motion: {"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},
    duoshuo: {
      userId: '0',
      author: '博主'
    },
    algolia: {
      applicationID: '',
      apiKey: '',
      indexName: '',
      hits: {"per_page":10},
      labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
    }
  };
</script>



  <link rel="canonical" href="https://tdnr.gitee.io/limh/2015/04/01/asm26/">





  <title>6.4 简化的段定义 | 土逗牛肉</title>
  








</head>

<body itemscope itemtype="http://schema.org/WebPage" lang="zh-Hans ">

  
  
    
  

  <div class="container sidebar-position-left page-post-detail">
    <div class="headband"></div>

    <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-wrapper">
  <div class="site-meta ">
    

    <div class="custom-logo-site-title">
      <a href="/limh/" class="brand" rel="start">
        <span class="logo-line-before"><i></i></span>
        <span class="site-title">土逗牛肉</span>
        <span class="logo-line-after"><i></i></span>
      </a>
    </div>
      
        <p class="site-subtitle"></p>
      
  </div>

  <div class="site-nav-toggle">
    <button>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
    </button>
  </div>
</div>

<nav class="site-nav">
  

  
    <ul id="menu" class="menu">
      
        
        <li class="menu-item menu-item-home">
          <a href="/limh/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-home"></i> <br>
            
            首页
          </a>
        </li>
      
        
        <li class="menu-item menu-item-archives">
          <a href="/limh/archives/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-archive"></i> <br>
            
            归档
          </a>
        </li>
      
        
        <li class="menu-item menu-item-tags">
          <a href="/limh/tags/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-tags"></i> <br>
            
            标签
          </a>
        </li>
      
        
        <li class="menu-item menu-item-categories">
          <a href="/limh/categories/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-th"></i> <br>
            
            分类
          </a>
        </li>
      
        
        <li class="menu-item menu-item-about">
          <a href="/limh/about/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-user"></i> <br>
            
            关于
          </a>
        </li>
      

      
    </ul>
  

  
</nav>



 </div>
    </header>

    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          <div id="content" class="content">
            

  <div id="posts" class="posts-expand">
    

  

  
  
  

  <article class="post post-type-normal" itemscope itemtype="http://schema.org/Article">
  
  
  
  <div class="post-block">
    <link itemprop="mainEntityOfPage" href="https://tdnr.gitee.io/limh/limh/2015/04/01/asm26/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="name" content="土逗牛肉">
      <meta itemprop="description" content>
      <meta itemprop="image" content="/limh/images/avatar.jpg">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="土逗牛肉">
    </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">6.4 简化的段定义</h1>
        

        <div class="post-meta">
          <span class="post-time">
            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">发表于</span>
              
              <time title="创建于" itemprop="dateCreated datePublished" datetime="2015-04-01T20:35:51+08:00">
                2015-04-01
              </time>
            

            

            
          </span>

          
            <span class="post-category">
            
              <span class="post-meta-divider">|</span>
            
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              
                <span class="post-meta-item-text">分类于</span>
              
              
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/limh/categories/汇编教程/" itemprop="url" rel="index">
                    <span itemprop="name">汇编教程</span>
                  </a>
                </span>

                
                
              
            </span>
          

          
            
          

          
          

          

          

          

        </div>
      </header>
    

    
    
    
    <div class="post-body" itemprop="articleBody">

      
      

      
        <p>前面，我们介绍了完整的段定义格式，用完整的段定义格式虽然可以控制段的各种属性，但程序员很少会这样做。现在的汇编程序提供了一种简化的段定义方式，它使定义段更简单、方便。</p>
<hr>
<h2 id="6-4-1-存储模型说明伪指令"><a href="#6-4-1-存储模型说明伪指令" class="headerlink" title="6.4.1 存储模型说明伪指令"></a>6.4.1 存储模型说明伪指令</h2><p>在使用简化的段定义方式之前，必须使用存储模式说明伪指令来描述源程序所采用的存储模式。该伪指令说程序所使用的存储模式，汇编程序将用该存储模式生成相应的ASSUME和GROUP语句，同时也为其它的简化段创建等价的预定义。</p>
<p>程序存储模式说明伪指令的格式如下：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">.MODEL  存储模式[，语言类型] [，操作系统类型] [，堆栈类型]</span><br></pre></td></tr></table></figure>
<p>程序可选的存储模式有：TINY、SMALL、COMPACT、MEDIUM、LARGE、HUGE和FLAT。</p>
<p>伪指令.MODEL必须写在源程序的首部，且只能出现一次，其前内容只能是注释。</p>
<p>如果用伪指令来指定程序所遵循的语言类型，那么，将不允许子程序的嵌套定义。与子程序定义有关的内容请见第7.5节。</p>
<p>###　一、存储模式</p>
<p>如果要用汇编语言编写被高级语言调用的子程序，那么，该汇编程序的存储模式必须与该高级语言编译(或解释)程序所使用的存储模式相匹配。汇编语言程序所能使用的存储模式、符号及其相关信息如表6.2所列。</p>
<p>在程序中，还可伪指令OPTION SEGMENT和SEGMENT来指定段的规模。</p>
<p>有关存储模式的具体规定如下：</p>
<p>TINY</p>
<p>在汇编程序MASM 6.11和TASM 4.0，该存储类型是为编写COM文件类型而设置的。程序员还可用汇编命令行选项/AT和连接命令选项/TINY来达到此目的。</p>
<p><strong>表6.2 存储模式的符号及其相关含义</strong></p>
<table>
<thead>
<tr>
<th></th>
<th>代码的位距</th>
<th>数据的位距</th>
<th>段的宽度</th>
<th>数据段和代码段能否合并</th>
</tr>
</thead>
<tbody>
<tr>
<td></td>
<td>Code Distance</td>
<td>Data Distance</td>
<td>Segment Width</td>
<td>Data &amp; Code Combined?</td>
</tr>
<tr>
<td>Tiny</td>
<td>NEAR</td>
<td>NEAR</td>
<td>16-bit</td>
<td>Yes</td>
</tr>
<tr>
<td>Small</td>
<td>NEAR</td>
<td>NEAR</td>
<td>16-bit</td>
<td>No</td>
</tr>
<tr>
<td>Compact</td>
<td>NEAR</td>
<td>FAR</td>
<td>16-bit</td>
<td>No</td>
</tr>
<tr>
<td>Medium</td>
<td>FAR</td>
<td>NEAR</td>
<td>16-bit</td>
<td>No</td>
</tr>
<tr>
<td>Large</td>
<td>FAR</td>
<td>FAR</td>
<td>16-bit</td>
<td>No</td>
</tr>
<tr>
<td>Huge</td>
<td>FAR</td>
<td>FAR</td>
<td>16-bit</td>
<td>No</td>
</tr>
<tr>
<td>Flat</td>
<td>NEAR</td>
<td>NEAR</td>
<td>32-bit</td>
<td>Yes</td>
</tr>
</tbody>
</table>
<p><strong>SMALL：</strong><br>所有的数据变量必须在一个数据段之内，所有的代码也必须在一个代码段之内。在这种模型下，数据段寄存器的内容保持不变，所有转移也都是段内转移。</p>
<p>该存储类型是独立汇编语言源程序常用的存储模型。</p>
<p><strong>MEDIUM：</strong><br>所有的数据变量必须在一个数据段之内，但代码段可以有多个。在这种模型下，数据段寄存器的内容保持不变，转移可以是段间转移。</p>
<p><strong>COMPACT：</strong><br>数据段可以有多个，但代码段只能有一。</p>
<p><strong>LARGE：</strong><br>数据段和代码段都可以有多个，但一个数组的字节数不能超过64KB。</p>
<p><strong>HUGE：</strong><br>数据段和代码段都可以有多个，一个数组的字节数也可以超过64KB。</p>
<p><strong>FLAT：</strong><br>FLAT存储模式在创建执行文件时，将使该程序仅含一个包括程序数据和代码的32位段，并且只能在80386及其以后的计算机系统中运行。该程序的文件类型为EXE。</p>
<p>在使用该存储模式之前，必须先用伪指令.386、.486或其它伪指令来说明更高性能的CPU类型。也就是说：FLAT模式仅在386及其以后CPU模式下才能使用。</p>
<p>在该程序中，所有代码和数据位距的缺省值都是NEAR，子程序的类型也是NEAR，并且标识符@CodeSize，@DataSize和@Model的值分别为：0、0和7。</p>
<p>在FLAT存储模式下，程序将不使用段寄存器FS和GS。汇编程序在处理说明语句“.MODEL  FLAT”时，将自动生成下列段寄存器说明语句：</p>
<blockquote>
<p>ASSUME  CS:FLAT, DS:FLAT, SS:FLAT, ES:FLAT, FS:ERROR, GS:ERROR</p>
</blockquote>
<p>当然，程序员也可把该段寄存器说明语句写在其指令序列之中。</p>
<h3 id="二、语言类型"><a href="#二、语言类型" class="headerlink" title="二、语言类型"></a>二、语言类型</h3><p>其详细说明请见7.5.3节中所述。</p>
<h3 id="三、操作系统类型"><a href="#三、操作系统类型" class="headerlink" title="三、操作系统类型"></a>三、操作系统类型</h3><p>OS_DOS是当前唯一支持的选项值，也是该选项的缺省值。</p>
<p>###四、堆栈类型</p>
<p>堆栈类型的值主要影响伪指令.STARTUP所生成的指令序列。该选项有二个可选值：NEARSTACK和FARSTACK。其中：NEARSTACK是该选项的缺省堆栈类型。</p>
<ul>
<li>NEARSTACK——堆栈段和数据段是同一段；</li>
<li>FARSTACK——堆栈段和数据段是不同的段，且堆栈不在段组DGROUP中。</li>
</ul>
<p>例如：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">.MODEL   SMALL, C, OS_DOS, FARSTACK</span><br></pre></td></tr></table></figure>
<h2 id="6-4-2-简化段定义伪指令"><a href="#6-4-2-简化段定义伪指令" class="headerlink" title="6.4.2 简化段定义伪指令"></a>6.4.2 简化段定义伪指令</h2><p>简化段定义伪指令在说明一个新段即将开始的同时，也说明了上一个段的结束。在本段定义结束时，也不必用伪指令“ENDS”来标识。</p>
<p>具体的伪指令说明形式及其功能描述如下：</p>
<h3 id="1、代码段定义"><a href="#1、代码段定义" class="headerlink" title="1、代码段定义"></a>1、代码段定义</h3><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">.CODE</span><br></pre></td></tr></table></figure>
<p>作用：说明其下面的内容是代码段中内容。</p>
<h3 id="2、堆栈段定义"><a href="#2、堆栈段定义" class="headerlink" title="2、堆栈段定义"></a>2、堆栈段定义</h3><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">.STACK  [堆栈字节数]</span><br></pre></td></tr></table></figure>
<p>其中，“堆栈字节数”可以不写，其缺省值为1024B。</p>
<h3 id="3、数据段定义"><a href="#3、数据段定义" class="headerlink" title="3、数据段定义"></a>3、数据段定义</h3><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">.DATA / .DATA? / .CONST</span><br></pre></td></tr></table></figure>
<p>作用：说明其下面的内容是数据段中的变量定义。</p>
<p>在一个源程序中，可以有多个伪指令.DATA定义的数据段，这就好象在源程序中定义多个同段名的数据段一样。</p>
<p>伪指令.DATA说明下面是一个未初始化数据段的开始，伪指令.CONST说明下面是一个常数数据段的开始。这二条伪指令很少使用，除非在与高级语言编写的程序相结合时，为了遵守高级语言的某些约定，而需要特殊说明时才使用。</p>
<p>汇编程序在处理简化的堆栈段和数据段定义时，它会自动地把伪指令.STACK、.DATA、.DATA?和.CONST所定义的段组合成一个段组。如果想定义一个独立的、不与其它段组合在一起的数据段的话，那么，就可选用下面的数据段定义方式。</p>
<h3 id="4、远程数据段定义"><a href="#4、远程数据段定义" class="headerlink" title="4、远程数据段定义"></a>4、远程数据段定义</h3><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">.FARDATA  [段名] / .FARDATA?  [段名]</span><br></pre></td></tr></table></figure>
<p>其中：“段名”是可选项，如果不指定的话，则该段名就取其缺省段名。</p>
<p>作用：说明一个独立的数据段。</p>
<p>伪指令.FARDATA?说明下面是一个未初始化的、独立数据段的开始。通常情况下，很少使用该伪指令。</p>
<h2 id="6-4-3-简化段段名的引用"><a href="#6-4-3-简化段段名的引用" class="headerlink" title="6.4.3 简化段段名的引用"></a>6.4.3 简化段段名的引用</h2><p>当使用简化的段定义时，一般情况下，程序员可以不知道这些段的段名、段地址堆齐类型和组合类型等。但当把简化定义的段和标准定义的段混合使用时，就需要知道简化定义段的基本属性。表6.3是在小模式下段的基本属性对应表。</p>
<p>表6.3 小模式下简化段定义的缺省属性表</p>
<table>
<thead>
<tr>
<th>伪指令</th>
<th>缺省段名</th>
<th>对齐类型</th>
<th>组合类型</th>
<th>类别</th>
<th>段组名</th>
</tr>
</thead>
<tbody>
<tr>
<td>.CODE</td>
<td>_TEXT</td>
<td>WORD</td>
<td>PUBLIC</td>
<td>‘CODE’    　</td>
<td></td>
</tr>
<tr>
<td>.FARDATA</td>
<td>FAR_DATA</td>
<td>PARA</td>
<td>NONE</td>
<td>‘FAR_DATA’</td>
<td></td>
</tr>
<tr>
<td>.FARDATA?</td>
<td>FAR_BSS</td>
<td>PARA</td>
<td>NONE</td>
<td>‘FAR_BSS’    　</td>
<td></td>
</tr>
<tr>
<td>.STACK</td>
<td>STACK</td>
<td>PARA</td>
<td>STACK</td>
<td>‘STACK’</td>
<td>DGROUP</td>
</tr>
<tr>
<td>.DATA</td>
<td>DATA</td>
<td>WORD</td>
<td>PUBLIC</td>
<td>‘DATA’</td>
<td>DGROUP</td>
</tr>
<tr>
<td>.DATA?</td>
<td>BSS</td>
<td>WORD</td>
<td>PUBLIC</td>
<td>‘BSS’</td>
<td>DGROUP</td>
</tr>
<tr>
<td>.CONST</td>
<td>CONST</td>
<td>WORD</td>
<td>PUBLIC</td>
<td>‘CONST’</td>
<td>DGROUP</td>
</tr>
</tbody>
</table>
<p>在其它存储模型下，由伪指令”.CODE”说明的代码段段名在”_TEXT”之前还要加上其模块名(源程序名)。假设，某模块名为ABC，则其缺省的代码段段名就为ABC_TEXT。因此，在这种情况下，程序的模块名或源程序名不要以数字开头。</p>
<p><strong>例6.15 简化段定义的方法</strong></p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br></pre></td><td class="code"><pre><span class="line">.MODEL?SMALL</span><br><span class="line"></span><br><span class="line">.STACK?128</span><br><span class="line"></span><br><span class="line">.DATA</span><br><span class="line"></span><br><span class="line">MSG  DB　&quot;Simplified Segment Directives.$&quot;</span><br><span class="line"></span><br><span class="line">.CODE</span><br><span class="line"></span><br><span class="line">MOV AX, @DATA ;取数据段的段值</span><br><span class="line"></span><br><span class="line">MOV DS, AX ;把给段寄存器DS赋值</span><br><span class="line"></span><br><span class="line">MOV DX, offset MSG</span><br><span class="line"></span><br><span class="line">MOV AH, 9H</span><br><span class="line"></span><br><span class="line">INT 21h</span><br><span class="line"></span><br><span class="line">MOV AX, 4C00H</span><br><span class="line"></span><br><span class="line">INT 21h</span><br><span class="line"></span><br><span class="line">END</span><br></pre></td></tr></table></figure>
<p>另外，在汇编程序MASM中，还提供了二组简化的代码伪指令：.STARTUP和.EXIT。</p>
<ul>
<li>.STARTUP——在代码段的开始，用于自动初始化寄存器DS、SS和SP；</li>
<li>.EXIT——用于结束程序的运行，它等价于下列二条语句：</li>
</ul>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">MOV　AH, 4CH </span><br><span class="line"> INT　　21h</span><br></pre></td></tr></table></figure>
<p>当使用汇编程序TASM时，以上二条伪指令分别改为：STARTUPCODE和EXITCODE。假设使用汇编程序MASM，那么，例6.15可改写成例6.16的形式。</p>
<p><strong>例6.16</strong></p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br></pre></td><td class="code"><pre><span class="line">.MODEL?SMALL</span><br><span class="line"></span><br><span class="line">.STACK?128</span><br><span class="line"></span><br><span class="line">.DATA</span><br><span class="line"></span><br><span class="line">MSG DB　&quot;Simplified Segment Directives.$&quot;</span><br><span class="line"></span><br><span class="line">.CODE</span><br><span class="line"></span><br><span class="line">.STARTUP　;自动初始化寄存器DS、SS和SP</span><br><span class="line"></span><br><span class="line">              MOV       DX, offset MSG</span><br><span class="line"></span><br><span class="line">              MOV       AH, 9H</span><br><span class="line"></span><br><span class="line">              INT       21h</span><br><span class="line"></span><br><span class="line">.EXIT</span><br><span class="line"></span><br><span class="line">              END</span><br></pre></td></tr></table></figure>
      
    </div>
    
    
    

    

    

    

    <footer class="post-footer">
      
        <div class="post-tags">
          
            <a href="/limh/tags/教程/" rel="tag"># 教程</a>
          
        </div>
      

      
      
      

      
        <div class="post-nav">
          <div class="post-nav-next post-nav-item">
            
              <a href="/limh/2015/04/01/asm25/" rel="next" title="6.3 段的基本属性">
                <i class="fa fa-chevron-left"></i> 6.3 段的基本属性
              </a>
            
          </div>

          <span class="post-nav-divider"></span>

          <div class="post-nav-prev post-nav-item">
            
              <a href="/limh/2015/04/01/asm27/" rel="prev" title="6.5 源程序的辅助说明伪指令">
                6.5 源程序的辅助说明伪指令 <i class="fa fa-chevron-right"></i>
              </a>
            
          </div>
        </div>
      

      
      
    </footer>
  </div>
  
  
  
  </article>



    <div class="post-spread">
      
    </div>
  </div>


          </div>
          


          

  
    <div class="comments" id="comments">
      <div id="SOHUCS"></div>
    </div>

  



        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    
    <div class="sidebar-inner">

      

      
        <ul class="sidebar-nav motion-element">
          <li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap">
            文章目录
          </li>
          <li class="sidebar-nav-overview" data-target="site-overview-wrap">
            站点概览
          </li>
        </ul>
      

      <section class="site-overview-wrap sidebar-panel">
        <div class="site-overview">
          <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
            
              <img class="site-author-image" itemprop="image" src="/limh/images/avatar.jpg" alt="土逗牛肉">
            
              <p class="site-author-name" itemprop="name">土逗牛肉</p>
              <p class="site-description motion-element" itemprop="description"></p>
          </div>

          <nav class="site-state motion-element">

            
              <div class="site-state-item site-state-posts">
              
                <a href="/limh/archives/">
              
                  <span class="site-state-item-count">255</span>
                  <span class="site-state-item-name">日志</span>
                </a>
              </div>
            

            
              
              
              <div class="site-state-item site-state-categories">
                <a href="/limh/categories/index.html">
                  <span class="site-state-item-count">8</span>
                  <span class="site-state-item-name">分类</span>
                </a>
              </div>
            

            
              
              
              <div class="site-state-item site-state-tags">
                <a href="/limh/tags/index.html">
                  <span class="site-state-item-count">7</span>
                  <span class="site-state-item-name">标签</span>
                </a>
              </div>
            

          </nav>

          

          
            <div class="links-of-author motion-element">
                
                  <span class="links-of-author-item">
                    <a href="https://github.com/limhGeek" target="_blank" title="GitHub">
                      
                        <i class="fa fa-fw fa-github"></i>GitHub</a>
                  </span>
                
                  <span class="links-of-author-item">
                    <a href="mailto:1591054297@qq.com" target="_blank" title="E-Mail">
                      
                        <i class="fa fa-fw fa-envelope"></i>E-Mail</a>
                  </span>
                
                  <span class="links-of-author-item">
                    <a href="https://www.jianshu.com/u/f73b243e7cc9" target="_blank" title="简书">
                      
                        <i class="fa fa-fw fa-user-circle-o"></i>简书</a>
                  </span>
                
            </div>
          

          
          

          
          

          

        </div>
      </section>

      
      <!--noindex-->
        <section class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active">
          <div class="post-toc">

            
              
            

            
              <div class="post-toc-content"><ol class="nav"><li class="nav-item nav-level-2"><a class="nav-link" href="#6-4-1-存储模型说明伪指令"><span class="nav-number">1.</span> <span class="nav-text">6.4.1 存储模型说明伪指令</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#二、语言类型"><span class="nav-number">1.1.</span> <span class="nav-text">二、语言类型</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#三、操作系统类型"><span class="nav-number">1.2.</span> <span class="nav-text">三、操作系统类型</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#6-4-2-简化段定义伪指令"><span class="nav-number">2.</span> <span class="nav-text">6.4.2 简化段定义伪指令</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#1、代码段定义"><span class="nav-number">2.1.</span> <span class="nav-text">1、代码段定义</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#2、堆栈段定义"><span class="nav-number">2.2.</span> <span class="nav-text">2、堆栈段定义</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#3、数据段定义"><span class="nav-number">2.3.</span> <span class="nav-text">3、数据段定义</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#4、远程数据段定义"><span class="nav-number">2.4.</span> <span class="nav-text">4、远程数据段定义</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#6-4-3-简化段段名的引用"><span class="nav-number">3.</span> <span class="nav-text">6.4.3 简化段段名的引用</span></a></li></ol></div>
            

          </div>
        </section>
      <!--/noindex-->
      

      

    </div>
  </aside>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <div class="copyright">&copy; <span itemprop="copyrightYear">2019</span>
  <span class="with-love">
    <i class="fa fa-user"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">土逗牛肉</span>

  
</div>


  <div class="powered-by">由 <a class="theme-link" target="_blank" href="https://hexo.io">Hexo</a> 强力驱动</div>



  <span class="post-meta-divider">|</span>



  <div class="theme-info">主题 &mdash; <a class="theme-link" target="_blank" href="https://github.com/iissnan/hexo-theme-next">NexT.Gemini</a> v5.1.4</div>




        







        
      </div>
    </footer>

    
      <div class="back-to-top">
        <i class="fa fa-arrow-up"></i>
        
      </div>
    

    

  </div>

  

<script type="text/javascript">
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
	var str = GetUrlParam('height');
    if (str === '0'){
		document.getElementById('header').style.display = 'none';
		document.getElementById('comments').style.display = 'none';
		document.getElementById('footer').style.display = 'none';
		document.getElementsByClassName('post-footer').item(0).style.display = 'none'
	}
	
    function GetUrlParam(paraName) {
        var url = document.location.toString();
        var arrObj = url.split("?");

        if (arrObj.length > 1) {
            var arrPara = arrObj[1].split("&");
            var arr;

            for (var i = 0; i < arrPara.length; i++) {
                 arr = arrPara[i].split("=");

                if (arr != null && arr[0] === paraName) {
                    return arr[1];
                }
            }
            return "";
        } else {
            return "";
        }
    }
</script>









  












  
  
    <script type="text/javascript" src="/limh/lib/jquery/index.js?v=2.1.3"></script>
  

  
  
    <script type="text/javascript" src="/limh/lib/fastclick/lib/fastclick.min.js?v=1.0.6"></script>
  

  
  
    <script type="text/javascript" src="/limh/lib/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script>
  

  
  
    <script type="text/javascript" src="/limh/lib/velocity/velocity.min.js?v=1.2.1"></script>
  

  
  
    <script type="text/javascript" src="/limh/lib/velocity/velocity.ui.min.js?v=1.2.1"></script>
  

  
  
    <script type="text/javascript" src="/limh/lib/fancybox/source/jquery.fancybox.pack.js?v=2.1.5"></script>
  


  


  <script type="text/javascript" src="/limh/js/src/utils.js?v=5.1.4"></script>

  <script type="text/javascript" src="/limh/js/src/motion.js?v=5.1.4"></script>



  
  


  <script type="text/javascript" src="/limh/js/src/affix.js?v=5.1.4"></script>

  <script type="text/javascript" src="/limh/js/src/schemes/pisces.js?v=5.1.4"></script>



  
  <script type="text/javascript" src="/limh/js/src/scrollspy.js?v=5.1.4"></script>
<script type="text/javascript" src="/limh/js/src/post-details.js?v=5.1.4"></script>



  


  <script type="text/javascript" src="/limh/js/src/bootstrap.js?v=5.1.4"></script>



  


  




	





  





  












  





  

  

  

  
  

  

  

  

</body>
</html>
